unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, ExtCtrls, Unit1;

type
  TSetupForm = class(TForm)
    LEUsername: TLabeledEdit;
    LEPassword: TLabeledEdit;
    LEStatsURL: TLabeledEdit;
    TBServerPollingInterval: TTrackBar;
    Label1: TLabel;
    Button1: TButton;
    LEKillURL: TLabeledEdit;
    LEListURL: TLabeledEdit;
    procedure Button1Click(Sender: TObject);
    procedure TBServerPollingIntervalChange(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SetupForm: TSetupForm;

implementation

{$R *.dfm}

procedure TSetupForm.Button1Click(Sender: TObject);
begin
  Form1.IdHTTP1.Request.Username:=icecast2.user;
  Form1.IdHTTP1.Request.Password:=icecast2.pass;
  icecast2.pollint:=TBServerPollingInterval.Position;
  Form1.Timer1.Interval:=icecast2.pollint * 1000;
  icecast2.xmlstatsurl:=LEStatsURL.Text;
  icecast2.listclientsurl:=LEListURL.Text;
  icecast2.kickclienturl:=LEKillURL.Text;
  SetupForm.Visible:=false;
end;

procedure TSetupForm.TBServerPollingIntervalChange(Sender: TObject);
begin
  Label1.Caption:='Server poll interval (seconds) = ' + IntToStr(TBServerPollingInterval.Position);
end;

procedure TSetupForm.FormCreate(Sender: TObject);
begin
  LEUsername.Text:=icecast2.user;
  LEPassword.Text:=icecast2.pass;
  LEStatsURL.Text:=icecast2.xmlstatsurl;
  LEListURL.Text:=icecast2.listclientsurl;
  LEKillURL.Text:=icecast2.kickclienturl;
  TBServerPollingInterval.Position:=icecast2.pollint;
end;

end.
